{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "344f010d-7e0a-493f-8ee6-38b73623257d",
   "metadata": {},
   "source": [
    "https://leetcode.com/problems/valid-number\n",
    "\n",
    "\n",
    "Runtime: 57 ms, faster than 12.96% of Python3 online submissions for Valid Number.\n",
    "Memory Usage: 14.2 MB, less than 62.37% of Python3 online submissions for Valid Number.\n",
    "\n",
    "\n",
    "```python\n",
    "import re\n",
    "\n",
    "class Solution:\n",
    "    def isNumber(self, s: str) -> bool:\n",
    "        #2022.1.10 8:23\n",
    "        try:\n",
    "            value = float(s)\n",
    "            if abs(value) == float('inf'):\n",
    "                #print(\"hi\")\n",
    "                #m = re.search('\\d+\\.*[eE]\\.*\\d+', s)\n",
    "                #if m != None:\n",
    "                #    return True\n",
    "                if \"e\" in s.lower():\n",
    "                    return True\n",
    "                return False\n",
    "            return True\n",
    "        except Exception as e:\n",
    "            return False\n",
    "        #2022.1.10 8:25\n",
    "        #debug until 8:34\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "cee825ae-4947-48bb-b0df-576025ddf51d",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
